home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 January / enter-2004-01.iso / files / maxima-5.9.0.exe / {app} / share / maxima / 5.9.0 / emacs / maxima-font-lock.el < prev    next >
Encoding:
Text File  |  2003-02-09  |  27.5 KB  |  1,420 lines

  1. ;;; maxima-font-lock.el --- syntax highlighting for maxima.el
  2.  
  3. ;; Copyright: (C) 2001 Jay Belanger
  4.  
  5. ;; Author: Jay Belanger <belanger@truman.edu>
  6. ;; $Name:  $
  7. ;; $Revision: 1.8 $
  8. ;; $Date: 2002/09/27 15:52:58 $
  9. ;; Keywords: maxima, font-lock
  10.  
  11. ;; This program is free software; you can redistribute it and/or
  12. ;; modify it under the terms of the GNU General Public License as
  13. ;; published by the Free Software Foundation; either version 2, or (at
  14. ;; your option) any later version.
  15. ;;
  16. ;; This program is distributed in the hope that it will be useful, but
  17. ;; WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  19. ;; General Public License for more details.
  20. ;;
  21. ;; You should have received a copy of the GNU General Public License
  22. ;; along with GNU Emacs; see the file COPYING.  If not, write to the
  23. ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  24. ;; Boston, MA 02111-1307, USA.
  25. ;;
  26. ;; Please send suggestions and bug reports to <belanger@truman.edu>
  27. ;; The latest version of this package should be available at
  28. ;; ftp://vh213601.truman.edu/pub/Maxima
  29.  
  30. ;;; Commentary
  31.  
  32. ;;; This file is used for font-lock for maxima.el
  33. ;;
  34. ;; The keywords are divided into the following groups, following the 
  35. ;; Maxima info files:
  36. ;; Functions (font-lock-builtin-face or font-lock-keyword-face)
  37. ;; Variables (font-lock-keyword-face)
  38. ;; Constants (font-lock-constant-face)
  39. ;; Keywords (font-lock-keyword-face)
  40. ;; Declarations (font-lock-keyword-face)
  41. ;; Operators (font-lock-keyword-face)
  42. ;; Property (font-lock-keyword-face)
  43. ;; Macros (font-lock-keyword-face)
  44. ;; Special operators (font-lock-keyword-face)
  45. ;; Special symbols (font-lock-keyword-face)
  46. ;;
  47.  
  48. ;;; Code
  49.  
  50. (require 'font-lock)
  51. (provide 'maxima-font-lock)
  52.  
  53.  
  54. ;;; The faces
  55. ;; (defvar maxima-variable-face 'maxima-variable-face
  56. ;;   "The face to use for the variables.")
  57.  
  58. ;; (defvar maxima-function-face 'maxima-function-face
  59. ;;   "The face to use for the functions.")
  60.  
  61. ;; (defvar maxima-constant-face 'maxima-constant-face
  62. ;;   "The face to use for the constants.")
  63.  
  64. ;; (defvar maxima-keyword-face 'maxima-keyword-face
  65. ;;   "The face to use for the keywords.")
  66.  
  67. ;; (defvar maxima-operator-face 'maxima-operator-face
  68. ;;   "The face to use for the operators.")
  69.  
  70. ;; (defvar maxima-property-face 'maxima-property-face
  71. ;;   "The face to use for the properties.")
  72.  
  73. ;; (defvar maxima-macro-face 'maxima-macro-face
  74. ;;   "The face to use for the macros.")
  75.  
  76. ;; (defvar maxima-specop-face 'maxima-specop-face
  77. ;;   "The face to use for the special operators.")
  78.  
  79. ;; (defvar maxima-declaration-face 'maxima-declaration-face
  80. ;;   "The face to use for the macros.")
  81.  
  82. ;; (defvar maxima-specsymb-face 'maxima-specsymb-face
  83. ;;   "The face to use for the special symbols.")
  84.  
  85. ;;; the regexps
  86. (defvar maxima-vars-1
  87.   (list
  88.    "%"
  89.    "%%"
  90.    "%edispflag"
  91.    "%rnum_list"))
  92.  
  93.  
  94. (defvar maxima-match-variables-1
  95.   (concat "\\<\\(" 
  96.           (regexp-opt maxima-vars-1)
  97.           "\\)\\>")
  98.   "regexp to match the maxima variables.")
  99.  
  100. (defvar maxima-vars-2
  101.   (list
  102.    "all_dotsimp_denoms"
  103.    "assume_pos"
  104.    "assume_pos_pred"
  105.    "change_filedefaults"
  106.    "current_let_rule_package"
  107.    "default_let_rule_package"
  108.    "display_format_internal"
  109.    "error_size"
  110.    "error_syms"
  111.    "expandwrt_denom"
  112.    "file_search"
  113.    "file_string_print"
  114.    "in_netmath"
  115.    "integration_constant_counter"
  116.    "isolate_wrt_times"
  117.    "let_rule_packages"
  118.    "linsolve_params"
  119.    "matrix_element_add"
  120.    "matrix_element_mult"
  121.    "matrix_element_transpose"
  122.    "mode_checkp"
  123.    "mode_check_errorp"
  124.    "mode_check_warnp"
  125.    "plot_options"
  126.    "solve_inconsistent_error"
  127.    "sublis_apply_lambda"
  128.    "taylor_logexpand"
  129.    "taylor_order_coefficients"
  130.    "taylor_truncate_polynomials"
  131.    "timer_devalue"
  132.    "tr_array_as_ref"
  133.    "tr_bound_function_applyp"
  134.    "tr_file_tty_messagesp"
  135.    "tr_float_can_branch_complex"
  136.    "tr_function_call_default"
  137.    "tr_gen_tags"
  138.    "tr_numer"
  139.    "tr_optimize_max_loop"
  140.    "tr_output_file_default"
  141.    "tr_predicate_brain_damage"
  142.    "tr_semicompile"
  143.    "tr_state_vars"
  144.    "tr_true_name_of_file_being_translated"
  145.    "tr_version"
  146.    "tr_warn_bad_function_calls"
  147.    "tr_warn_fexpr"
  148.    "tr_warn_meval"
  149.    "tr_warn_mode"
  150.    "tr_warn_undeclared"
  151.    "tr_warn_undefined_variable"
  152.    "tr_windy"
  153.    "use_fast_arrays"))
  154.    
  155.    
  156. (defvar maxima-match-variables-2
  157.   (concat "\\<\\("
  158.           (regexp-opt maxima-vars-2)
  159.           "\\)\\>")
  160.   "regexp to match the maxima variables.")
  161.  
  162. (defvar maxima-vars-3
  163.   (list
  164.    "absboxchar"
  165.    "activecontexts"
  166.    "algebraic"
  167.    "algepsilon"
  168.    "algexact"
  169.    "aliases"
  170.    "allsym"
  171.    "arrays"
  172.    "askexp"
  173.    "assumescalar"
  174.    "backsubst"
  175.    "backtrace"
  176.    "batchkill"
  177.    "batcount"
  178.    "berlefact"
  179.    "bftorat"
  180.    "bftrunc"
  181.    "bothcases"
  182.    "boxchar"
  183.    "breakup"
  184.    "cauchysum"
  185.    "cflength"
  186.    "compgrind"
  187.    "context"
  188.    "contexts"
  189.    "counter"
  190.    "cursordisp"
  191.    "debugmode"
  192.    "demoivre"
  193.    "dependencies"
  194.    "derivabbrev"
  195.    "derivsubst"
  196.    "detout"
  197.    "diagmetric"
  198.    "dim"
  199.    "direc"
  200.    "dispflag"
  201.    "display2d"
  202.    "doallmxops"
  203.    "domain"
  204.    "domxexpt"
  205.    "domxmxops"
  206.    "domxnctimes"
  207.    "dontfactor"
  208.    "doscmxops"
  209.    "doscmxplus"
  210.    "dot0nscsimp"
  211.    "dot0simp"
  212.    "dot1simp"
  213.    "dotassoc"
  214.    "dotconstrules"
  215.    "dotdistrib"
  216.    "dotexptsimp"
  217.    "dotident"
  218.    "dotscrules"
  219.    "dskall"
  220.    "erfflag"
  221.    "errexp"
  222.    "errintsce"
  223.    "errorfun"
  224.    "evflag"
  225.    "evfun"
  226.    "exptdispflag"
  227.    "expon"
  228.    "exponentialize"
  229.    "expop"
  230.    "exptisolate"
  231.    "exptsubst"
  232.    "facexpand"
  233.    "factlim"
  234.    "factorflag"
  235.    "filename"
  236.    "filenum"
  237.    "float2bf"
  238.    "fortindent"
  239.    "fortspaces"
  240.    "fpprec"
  241.    "fpprintprec"
  242.    "functions"
  243.    "gammalim"
  244.    "genindex"
  245.    "gensumnum"
  246.    "globalsolve"
  247.    "gradefs"
  248.    "halfangles"
  249.    "ibase"
  250.    "ieqnprint"
  251.    "inchar"
  252.    "inflag"
  253.    "intfaclim"
  254.    "infolists"
  255.    "intpolabs"
  256.    "intpolerror"
  257.    "intpolrel"
  258.    "keepfloat"
  259.    "lasttime"
  260.    "letrat"
  261.    "lhospitallim"
  262.    "linechar"
  263.    "linedisp"
  264.    "linel"
  265.    "linenum"
  266.    "linsolvewarn"
  267.    "listarith"
  268.    "listconstvars"
  269.    "listdummyvars"
  270.    "lmxchar"
  271.    "loadprint"
  272.    "logabs"
  273.    "logarc"
  274.    "logconcoeffp"
  275.    "logexpand"
  276.    "lognegint"
  277.    "lognumer"
  278.    "logsimp"))   
  279.  
  280. (defvar maxima-match-variables-3
  281.   (concat "\\<\\("
  282.           (regexp-opt maxima-vars-3)
  283.           "\\)\\>")
  284.   "regexp to match the maxima variables.")
  285.  
  286. (defvar maxima-vars-4
  287.   (list
  288.    "m1pbranch"
  289.    "macroexpansion"
  290.    "maperror"
  291.    "maxapplydepth"
  292.    "maxapplyheight"
  293.    "maxnegex"
  294.    "maxposex"
  295.    "maxprime"
  296.    "maxtayorder"
  297.    "modulus"
  298.    "multiplicities"
  299.    "myoptions"
  300.    "negdistrib"
  301.    "negsumdispflag"
  302.    "newfac"
  303.    "niceindicespref"
  304.    "nolabels"
  305.    "noundisp"
  306.    "obase"
  307.    "omega"
  308.    "opproperties"
  309.    "opsubst"
  310.    "optimprefix"
  311.    "optionset"
  312.    "packagefile"
  313.    "parsewindow"
  314.    "partswitch"
  315.    "pfeformat"
  316.    "piece"
  317.    "poislim"
  318.    "powerdisp"
  319.    "prederror"
  320.    "prodhack"
  321.    "programmode"
  322.    "prompt"
  323.    "psexpand"
  324.    "radexpand"
  325.    "radprodexpand"
  326.    "ratalgdenom"
  327.    "ratdenomdivide"
  328.    "ratepsilon"
  329.    "rateinstein"
  330.    "ratfac"
  331.    "ratmx"
  332.    "ratprint"
  333.    "ratrieman"
  334.    "ratriemann"
  335.    "ratsimpexpons"
  336.    "ratweights"
  337.    "ratweyl"
  338.    "ratwtlvl"
  339.    "realonly"
  340.    "refcheck"
  341.    "rmxchar"
  342.    "rombergabs"
  343.    "rombergit"
  344.    "rombergmin"
  345.    "rombergtol"
  346.    "rootsconmode"
  347.    "rootsepsilon"
  348.    "savedef"
  349.    "savefactors"
  350.    "scalarmatrixp"
  351.    "setcheck"
  352.    "setcheckbreak"
  353.    "setval"
  354.    "showtime"
  355.    "simpsum"
  356.    "solvedecomposes"
  357.    "solveexplicit"
  358.    "solvefactors"
  359.    "solvenullwarn"
  360.    "solveradcan"
  361.    "solvetrigwarn"
  362.    "sparse"
  363.    "sqrtdispflag"
  364.    "stardisp"
  365.    "sumexpand"
  366.    "sumhack"
  367.    "sumsplitfact"
  368.    "taylordepth"
  369.    "tlimswitch"
  370.    "transbind"
  371.    "transcompile"
  372.    "transrun"
  373.    "trigexpandplus"
  374.    "trigexpandtimes"
  375.    "triginverses"
  376.    "trigsign"
  377.    "ttyintfun"
  378.    "ttyintnum"
  379.    "ttyoff"
  380.    "undeclaredwarn"
  381.    "values"
  382.    "vect_cross"
  383.    "verbose"
  384.    "zerobern"
  385.    "zeta%pi"
  386.    "zunderflow"))
  387.    
  388.  
  389. (defvar maxima-match-variables-4
  390.   (concat "\\<\\("
  391.           (regexp-opt maxima-vars-4)
  392.           "\\)\\>")
  393.   "regexp to match the maxima variables.")
  394.  
  395. (defvar maxima-fns-1
  396.   (list
  397.    "%"
  398.    "%th"
  399.    "%j"
  400.    "%k"
  401.    "?round"
  402.    "?truncate"))
  403.                         
  404.  
  405. (defvar maxima-match-functions-1
  406.   (concat "\\<\\("
  407.           (regexp-opt maxima-fns-1)
  408.           "\\)\\>" )
  409.   "regexp to match the maxima functions.")
  410.  
  411. (defvar maxima-fns-2
  412.   (list
  413.    "acos"
  414.    "acosh"
  415.    "acot"
  416.    "acoth"
  417.    "acsc"
  418.    "acsch"
  419.    "activate"
  420.    "addcol"
  421.    "addrow"
  422.    "adjoint"
  423.    "airy"
  424.    "alarmclock"
  425.    "algsys"
  426.    "alias"
  427.    "alloc"
  428.    "allroots"
  429.    "antid"
  430.    "antidiff"
  431.    "append"
  432.    "appendfile"
  433.    "apply"
  434.    "apply1"
  435.    "apply2"
  436.    "applyb1"
  437.    "apply_nouns"
  438.    "apropos"
  439.    "args"
  440.    "array"
  441.    "arrayapply"
  442.    "arrayinfo"
  443.    "arraymake"
  444.    "asec"
  445.    "asech"
  446.    "asin"
  447.    "asinh"
  448.    "askinteger"
  449.    "asksign"
  450.    "assume"
  451.    "asymp"
  452.    "asympa"
  453.    "at"
  454.    "atan"
  455.    "atan2"
  456.    "atanh"
  457.    "atom"
  458.    "atrig1"
  459.    "atvalue"
  460.    "augcoefmatrix"
  461.    "backup"
  462.    "bashindices"
  463.    "batch"
  464.    "batchload"
  465.    "batcon"
  466.    "bern"
  467.    "bernpoly"
  468.    "bessel"
  469.    "beta"
  470.    "bezout"
  471.    "bffac"
  472.    "bfloat"
  473.    "bfloatp"
  474.    "bfpsi"
  475.    "bfzeta"
  476.    "bgzeta"
  477.    "bhzeta"
  478.    "bindtest"
  479.    "binomial"
  480.    "block"
  481.    "bothcoef"
  482.    "box"
  483.    "break"
  484.    "bug"
  485.    "burn"
  486.    "bzeta"
  487.    "cabs"
  488.    "canform"
  489.    "canten"
  490.    "carg"
  491.    "cartan"
  492.    "catch"
  493.    "cbfac"
  494.    "cf"
  495.    "cfdisrep"
  496.    "cfexpand"
  497.    "cgamma"
  498.    "cgamma2"
  499.    "changevar"
  500.    "charpoly"
  501.    "check_overlaps"
  502.    "chr1"
  503.    "chr2"
  504.    "christof"
  505.    "clearscreen"
  506.    "closefile"
  507.    "closeps"
  508.    "coeff"
  509.    "coefmatrix"
  510.    "col"
  511.    "collapse"
  512.    "columnvector"
  513.    "combine"
  514.    "comp2pui"
  515.    "compfile"
  516.    "compile"
  517.    "compile_file"
  518.    "compile_lisp_file"
  519.    "concat"
  520.    "conjugate"
  521.    "cons"
  522.    "constantp"
  523.    "cont2part"
  524.    "content"
  525.    "continue"
  526.    "contract"
  527.    "contract"
  528.    "copylist"
  529.    "copymatrix"
  530.    "cos"
  531.    "cosh"
  532.    "cot"
  533.    "coth"
  534.    "covdiff"
  535.    "create_list"
  536.    "csc"
  537.    "csch"
  538.    "curvature"
  539.    "dblint"
  540.    "ddt"
  541.    "deactivate"
  542.    "debug"
  543.    "debugprintmode"
  544.    "declare"
  545.    "declare_translated"
  546.    "declare_weight"
  547.    "defcon"
  548.    "define"
  549.    "define_variable"
  550.    "defint"
  551.    "defmatch"
  552.    "defrule"
  553.    "deftaylor"
  554.    "delete"
  555.    "delfile"
  556.    "delta"
  557.    "demo"
  558.    "denom"
  559.    "depends"
  560.    "derivdegree"
  561.    "derivlist"
  562.    "describe"
  563.    "desolve"
  564.    "determinant"
  565.    "diagmatrix"
  566.    "diff"
  567.    "dimension"
  568.    "direct"
  569.    "diskfree"
  570.    "disolate"
  571.    "disp"
  572.    "dispcon"
  573.    "dispform"
  574.    "dispfun"
  575.    "display"
  576.    "disprule"
  577.    "dispterms"
  578.    "distrib"
  579.    "divide"
  580.    "divsum"
  581.    "dotsimp"
  582.    "dpart"
  583.    "dscalar"
  584.    "dummy"))
  585.    
  586.  
  587. (defvar maxima-match-functions-2
  588.   (concat "\\<\\("
  589.           (regexp-opt maxima-fns-2)
  590.           "\\)\\>")
  591.   "regexp to match the maxima functions.")
  592.  
  593. (defvar maxima-fns-3
  594.   (list
  595.    "echelon"
  596.    "eigenvalues"
  597.    "eigenvectors"
  598.    "einstein"
  599.    "ele2comp"
  600.    "ele2polynome"
  601.    "ele2pui"
  602.    "elem"
  603.    "eliminate"
  604.    "ematrix"
  605.    "endcons"
  606.    "entermatrix"
  607.    "entier"
  608.    "equal"
  609.    "erf"
  610.    "errcatch"
  611.    "error"
  612.    "errormsg"
  613.    "euler"
  614.    "ev"
  615.    "eval"
  616.    "evenp"
  617.    "example"
  618.    "exp"
  619.    "expand"
  620.    "expandwrt"
  621.    "expandwrt_factored"
  622.    "explose"
  623.    "express"
  624.    "expt"
  625.    "extract_linear_equations"
  626.    "ezgcd"
  627.    "factcomb"
  628.    "factor"
  629.    "factorial"
  630.    "factorout"
  631.    "factorsum"
  632.    "facts"
  633.    "fassave"
  634.    "fasttimes"
  635.    "fast_central_elements"
  636.    "fast_linsolve"
  637.    "featurep"
  638.    "fft"
  639.    "fib"
  640.    "fibtophi"
  641.    "filedefaults"
  642.    "filename_merge"
  643.    "file_type"
  644.    "fillarray"
  645.    "first"
  646.    "fix"
  647.    "float"
  648.    "floatdefunk"
  649.    "floatnump"
  650.    "flush"
  651.    "flushd"
  652.    "flushnd"
  653.    "forget"
  654.    "fortmx"
  655.    "fortran"
  656.    "freeof"
  657.    "fullmap"
  658.    "fullmapl"
  659.    "fullratsimp"
  660.    "fullratsubst"
  661.    "funcsolve"
  662.    "fundef"
  663.    "funmake"))
  664.    
  665.  
  666. (defvar maxima-match-functions-3
  667.   (concat "\\<\\("
  668.           (regexp-opt maxima-fns-3)
  669.           "\\)\\>")
  670.   "regexp to match the maxima functions.")
  671.  
  672. (defvar maxima-fns-4
  673.   (list
  674.    "gamma"
  675.    "gauss"
  676.    "gcd"
  677.    "gcfactor"
  678.    "gendiff"
  679.    "genfact"
  680.    "genmatrix"
  681.    "get"
  682.    "getchar"
  683.    "gfactor"
  684.    "gfactorsum"
  685.    "go"
  686.    "gradef"
  687.    "gramschmidt"
  688.    "grind"
  689.    "grobner_basis"
  690.    "hach"
  691.    "hipow"
  692.    "horner"
  693.    "ic1"
  694.    "ident"
  695.    "ieqn"
  696.    "ift"
  697.    "ilt"
  698.    "imagpart"
  699.    "indices"
  700.    "infix"
  701.    "innerproduct"
  702.    "inpart"
  703.    "inrt"
  704.    "integerp"
  705.    "integrate"
  706.    "interpolate"
  707.    "intopois"
  708.    "intosum"
  709.    "intsce"
  710.    "invert"
  711.    "is"
  712.    "isolate"
  713.    "isqrt"
  714.    "jacobi"
  715.    "kdelta"
  716.    "kill"
  717.    "killcontext"
  718.    "kostka"
  719.    "labels"
  720.    "laplace"
  721.    "last"
  722.    "lc"
  723.    "lcm"
  724.    "ldefint"
  725.    "ldisp"
  726.    "ldisplay"
  727.    "length"
  728.    "let"
  729.    "letrules"
  730.    "letsimp"
  731.    "lgtreillis"
  732.    "lhs"
  733.    "limit"
  734.    "linsolve"
  735.    "lispdebugmode"
  736.    "listarray"
  737.    "listofvars"
  738.    "listp"
  739.    "list_nc_monomials"
  740.    "load"
  741.    "loadfile"
  742.    "local"
  743.    "log"
  744.    "logcontract"
  745.    "lopow"
  746.    "lorentz"
  747.    "lpart"
  748.    "lratsubst"
  749.    "lriccicom"
  750.    "ltreillis"))
  751.    
  752.  
  753. (defvar maxima-match-functions-4
  754.   (concat "\\<\\("
  755.           (regexp-opt maxima-fns-4)
  756.           "\\)\\>")
  757.   "regexp to match the maxima functions.")
  758.  
  759. (defvar maxima-fns-5
  760.   (list
  761.    "makebox"
  762.    "makefact"
  763.    "makegamma"
  764.    "makelist"
  765.    "make_array"
  766.    "map"
  767.    "mapatom"
  768.    "maplist"
  769.    "matchdeclare"
  770.    "matchfix"
  771.    "matrix"
  772.    "matrixmap"
  773.    "matrixp"
  774.    "mattrace"
  775.    "max"
  776.    "member"
  777.    "metric"
  778.    "min"
  779.    "minfactorial"
  780.    "minor"
  781.    "mod"
  782.    "mode_declare"
  783.    "mode_identity"
  784.    "mon2schur"
  785.    "mono"
  786.    "monomial_dimensions"
  787.    "motion"
  788.    "multinomial"
  789.    "multi_elem"
  790.    "multi_orbit"
  791.    "multi_pui"
  792.    "multsym"
  793.    "multthru"
  794.    "ncexpt"
  795.    "ncharpoly"
  796.    "nc_degree"
  797.    "new-disrep"
  798.    "newcontext"
  799.    "newdet"
  800.    "newton"
  801.    "niceindices"
  802.    "nonscalarp"
  803.    "nostring"
  804.    "nounify"
  805.    "nroots"
  806.    "nterms"
  807.    "ntermsg"
  808.    "ntermsrci"
  809.    "nthroot"
  810.    "num"
  811.    "numberp"
  812.    "numerval"
  813.    "numfactor"
  814.    "nusum"
  815.    "nzeta"
  816.    "oddp"
  817.    "ode"
  818.    "ode2"
  819.    "openplot_curves"
  820.    "optimize"
  821.    "orbit"
  822.    "ordergreat"
  823.    "ordergreatp"
  824.    "orderless"
  825.    "orderlessp"
  826.    "outchar"
  827.    "outofpois"
  828.    "pade"
  829.    "part"
  830.    "part2cont"
  831.    "partfrac"
  832.    "partition"
  833.    "partpol"
  834.    "pcoeff"
  835.    "permanent"
  836.    "permut"
  837.    "pickapart"
  838.    "playback"
  839.    "plog"
  840.    "plot2d"
  841.    "plot2d"
  842.    "plot2d_ps"
  843.    "plot3d"
  844.    "plot3d"
  845.    "poisdiff"
  846.    "poisexpt"
  847.    "poisint"
  848.    "poismap"
  849.    "poisplus"
  850.    "poissimp"
  851.    "poissubst"
  852.    "poistimes"
  853.    "poistrim"
  854.    "polarform"
  855.    "polartorect"
  856.    "polynome2ele"
  857.    "potential"
  858.    "powers"
  859.    "powerseries"
  860.    "pred"
  861.    "prime"
  862.    "primep"
  863.    "print"
  864.    "printpois"
  865.    "printprops"
  866.    "prodrac"
  867.    "product"
  868.    "properties"
  869.    "props"
  870.    "propvars"
  871.    "pscom"
  872.    "psdraw_curve"
  873.    "psi"
  874.    "pui"
  875.    "pui2comp"
  876.    "pui2ele"
  877.    "pui2polynome"
  878.    "puireduc"
  879.    "pui_direct"
  880.    "put"
  881.    "qput"
  882.    "qq"
  883.    "quanc8"
  884.    "quit"
  885.    "qunit"
  886.    "quotient"))
  887.  
  888.  
  889. (defvar maxima-match-functions-5
  890.   (concat "\\<\\("
  891.           (regexp-opt maxima-fns-5)
  892.           "\\)\\>")
  893.   "regexp to match the maxima functions.")
  894.  
  895. (defvar maxima-fns-6
  896.   (list
  897.    "radcan"
  898.    "radsubstflag"
  899.    "raiseriemann"
  900.    "random"
  901.    "rank"
  902.    "rat"
  903.    "ratcoef"
  904.    "ratdenom"
  905.    "ratdiff"
  906.    "ratdisrep"
  907.    "ratexpand"
  908.    "ratnumer"
  909.    "ratnump"
  910.    "ratp"
  911.    "ratsimp"
  912.    "ratsubst"
  913.    "ratvars"
  914.    "ratweight"
  915.    "read"
  916.    "readonly"
  917.    "realpart"
  918.    "realroots"
  919.    "rearray"
  920.    "rectform"
  921.    "recttopolar"
  922.    "rem"
  923.    "remainder"
  924.    "remarray"
  925.    "rembox"
  926.    "remcon"
  927.    "remfunction"
  928.    "remlet"
  929.    "remove"
  930.    "remrule"
  931.    "remtrace"
  932.    "remvalue"
  933.    "rename"
  934.    "reset"
  935.    "residue"
  936.    "resolvante"
  937.    "resolvante_alternee1"
  938.    "resolvante_bipartite"
  939.    "resolvante_diedrale"
  940.    "resolvante_klein"
  941.    "resolvante_klein3"
  942.    "resolvante_produit_sym"
  943.    "resolvante_unitaire"
  944.    "resolvante_vierer"
  945.    "rest"
  946.    "restore"
  947.    "resultant"
  948.    "return"
  949.    "reveal"
  950.    "reverse"
  951.    "revert"
  952.    "rhs"
  953.    "riccicom"
  954.    "riemann"
  955.    "rinvariant"
  956.    "risch"
  957.    "rncombine"
  958.    "romberg"
  959.    "room"
  960.    "rootscontract"
  961.    "row"
  962.    "save"
  963.    "scalarp"
  964.    "scalefactors"
  965.    "scanmap"
  966.    "schur2comp"
  967.    "sconcat"
  968.    "scsimp"
  969.    "scurvature"
  970.    "sec"
  971.    "sech"
  972.    "setelmx"
  973.    "setup"
  974.    "setup_autoload"
  975.    "set_plot_option"
  976.    "set_up_dot_simplifications"
  977.    "show"
  978.    "showratvars"
  979.    "sign"
  980.    "signum"
  981.    "similaritytransform"
  982.    "simp"
  983.    "sin"
  984.    "sinh"
  985.    "solve"
  986.    "somrac"
  987.    "sort"
  988.    "splice"
  989.    "sprint"
  990.    "sqfr"
  991.    "sqrt"
  992.    "srrat"
  993.    "sstatus"
  994.    "status"
  995.    "string"
  996.    "stringout"
  997.    "sublis"
  998.    "sublist"
  999.    "submatrix"
  1000.    "subst"
  1001.    "substinpart"
  1002.    "substpart"
  1003.    "subvarp"
  1004.    "sum"
  1005.    "sumcontract"
  1006.    "supcontext"
  1007.    "symbolp"
  1008.    "system"
  1009.    "tan"
  1010.    "tanh"
  1011.    "taylor"
  1012.    "taylorinfo"
  1013.    "taylorp"
  1014.    "taylor_simplifier"
  1015.    "taytorat"
  1016.    "tcl_output"
  1017.    "tcontract"
  1018.    "tellrat"
  1019.    "tellsimp"
  1020.    "tellsimpafter"
  1021.    "tex"
  1022.    "throw"
  1023.    "time"
  1024.    "timer"
  1025.    "timer_info"
  1026.    "tldefint"
  1027.    "tlimit"
  1028.    "tobreak"
  1029.    "todd_coxeter"
  1030.    "toplevel"
  1031.    "totaldisrep"
  1032.    "totient"
  1033.    "to_lisp"
  1034.    "tpartpol"
  1035.    "trace"
  1036.    "trace_options"
  1037.    "transform"
  1038.    "translate"
  1039.    "translate_file"
  1040.    "transpose"
  1041.    "treillis"
  1042.    "treinat"
  1043.    "triangularize"
  1044.    "trigexpand"
  1045.    "trigrat"
  1046.    "trigreduce"
  1047.    "trigsimp"
  1048.    "trunc"
  1049.    "tr_warnings_get"
  1050.    "tsetup"
  1051.    "ttransform"
  1052.    "undiff"
  1053.    "uniteigenvectors"
  1054.    "unitvector"
  1055.    "unknown"
  1056.    "unorder"
  1057.    "unsum"
  1058.    "untellrat"
  1059.    "untrace"
  1060.    "vectorpotential"
  1061.    "vectorsimp"
  1062.    "verbify"
  1063.    "weyl"
  1064.    "writefile"
  1065.    "xgraph_curves"
  1066.    "xthru"
  1067.    "zeroequiv"
  1068.    "zeromatrix"
  1069.    "zeta"
  1070.    "zrpoly"
  1071.    "zsolve"))
  1072.  
  1073.  
  1074. (defvar maxima-match-functions-6
  1075.   (concat "\\<\\("
  1076.           (regexp-opt maxima-fns-6)
  1077.           "\\)\\>")
  1078.   "regexp to match the maxima functions.")
  1079.  
  1080. (defvar maxima-const-1
  1081.   (list
  1082.    "%e"
  1083.    "%pi"))
  1084.  
  1085.  
  1086. (defvar maxima-match-constants-1
  1087.   (concat "\\<"
  1088.           (regexp-opt maxima-const-1)
  1089.           "\\>")
  1090.   "regexp to match the maxima constants.")
  1091.  
  1092. (defvar maxima-const-2
  1093.   (list
  1094.    "false"
  1095.    "inf"
  1096.    "infinity"
  1097.    "minf"
  1098.    "true"))
  1099.  
  1100. (defvar maxima-match-constants-2
  1101.   (concat "\\<\\("
  1102.           (regexp-opt maxima-const-2)
  1103.           "\\)\\>")
  1104.   "regexp to match the maxima constants.")
  1105.  
  1106. (defvar maxima-match-constants-3
  1107.   "\\<\\([0-9]+\\)\\>"
  1108.   "regexp to match the maxima constants.")
  1109.  
  1110. (defvar maxima-match-constants-4
  1111.   "\\<\\([0-9]+\.\\)?\\([0-9]+b[+-]?[0-9]\\)\\>"
  1112.   "regexp to match the maxima constants.")
  1113.  
  1114. (defvar maxima-keywds
  1115.   (list
  1116.    "allbut"))   
  1117.  
  1118. (defvar maxima-match-keywords
  1119.   (concat "\\<\\("
  1120.           (regexp-opt maxima-keywds)
  1121.           "\\)\\>")
  1122.   "regexp to match the maxima keywords.")
  1123.  
  1124. (defvar maxima-match-operators
  1125.   (regexp-opt '(
  1126.                 "'"
  1127.                 "''"
  1128.                 "!"
  1129.                 "!!"
  1130.                 "#"
  1131.                 "."
  1132.                 ":"
  1133.                 "::"
  1134.                 "::="
  1135.                 ":="
  1136.                 "="
  1137.                 "<"
  1138.                 ">"
  1139.                 "+"
  1140.                 "-"
  1141.                 "*"
  1142.                 "/"
  1143.                 "^"
  1144.                 ) t)
  1145.   "regexp to match the maxima operators.")
  1146.  
  1147. (defvar maxima-props
  1148.   (list
  1149.    "atomgrad"))
  1150.  
  1151.  
  1152. (defvar maxima-match-properties
  1153.   (concat "\\<\\("
  1154.           (regexp-opt maxima-props)
  1155.           "\\)\\>")
  1156.   "regexp to match maxima properties.")
  1157.  
  1158. (defvar maxima-macros
  1159.   (list
  1160.    "buildq"
  1161.    "with_stdout"))
  1162.  
  1163.  
  1164. (defvar maxima-match-macros
  1165.   (concat "\\<\\("
  1166.           (regexp-opt maxima-macros)
  1167.           "\\)\\>")
  1168.   "regexp to match maxima macros.")
  1169.  
  1170. (defvar maxima-specops
  1171.   (list
  1172.    "do"
  1173.    "else"
  1174.    "for"
  1175.    "if"
  1176.    "step"
  1177.    "then"
  1178.    "thru"
  1179.    "unless"
  1180.    "while"))
  1181.                         
  1182.  
  1183. (defvar maxima-match-specops
  1184.   (concat "\\<\\("
  1185.           (regexp-opt maxima-specops)
  1186.           "\\)\\>")
  1187.   "regexp to match maxima special operators.")
  1188.  
  1189. (defvar maxima-decs
  1190.   (list
  1191.    "alphabetic"
  1192.    "antisymmetric"
  1193.    "commutative"
  1194.    "feature"
  1195.    "features"
  1196.    "lassociative"
  1197.    "linear"
  1198.    "mainvar"
  1199.    "multiplicative"
  1200.    "nonscalar"
  1201.    "noun"
  1202.    "outative"
  1203.    "posfun"
  1204.    "rassociative"
  1205.    "symmetric"))
  1206.  
  1207.  
  1208. (defvar maxima-match-declarations
  1209.   (concat "\\<\\("
  1210.           (regexp-opt maxima-decs)
  1211.           "\\)\\>")
  1212.   "regexp to match maxima declarations.")
  1213.  
  1214. (defvar maxima-spsymbs-1
  1215.   (list
  1216.    "additive"
  1217.    "constant"
  1218.    "infeval"
  1219.    "noeval"
  1220.    "nouns"
  1221.    "numer"
  1222.    "poisson"
  1223.    "verb"))
  1224.  
  1225.  
  1226. (defvar maxima-match-specsymbs-1
  1227.   (concat "\\<\\("
  1228.           (regexp-opt maxima-spsymbs-1)
  1229.           "\\)\\>")
  1230.   "regexp to match maxima special symbols.")
  1231.  
  1232. (defvar maxima-match-specsymbs-2
  1233.   "\\(\\<\\?\\sw+\\>\\)"
  1234.   "regexp to match maxima special symbols.")
  1235.  
  1236. ;;; now, create the faces.
  1237.  
  1238. ;; (defface maxima-function-face
  1239. ;;   '((((type tty) (class color)) (:foreground "blue" :weight bold))
  1240. ;;     (((class color) (background light)) (:foreground "blue" :weight bold))
  1241. ;;     (((class color) (background dark)) (:foreground "lightskyblue" :weight bold))
  1242. ;;     (t (:inverse-video t :bold t)))
  1243. ;;   "font lock mode face used to highlight function names."
  1244. ;;   :group 'maxima)
  1245.  
  1246. ;; (defface maxima-constant-face
  1247. ;;   '((((type tty) (class color)) (:foreground "magenta"))
  1248. ;;     (((class grayscale) (background light))
  1249. ;;      (:foreground "lightgray" :bold t :underline t))
  1250. ;;     (((class grayscale) (background dark))
  1251. ;;      (:foreground "gray50" :bold t :underline t))
  1252. ;;     (((class color) (background light)) (:foreground "cadetblue" :weight bold))
  1253. ;;     (((class color) (background dark)) (:foreground "aquamarine" :weight bold))
  1254. ;;     (t (:bold t :underline t)))
  1255. ;;   "font lock mode face used to highlight constants and labels."
  1256. ;;   :group 'maxima)
  1257.  
  1258. ;; (defface maxima-keyword-face
  1259. ;;   '((((type tty) (class color)) (:foreground "cyan" :weight bold))
  1260. ;;     (((class grayscale) (background light)) (:foreground "lightgray" :bold t))
  1261. ;;     (((class grayscale) (background dark)) (:foreground "dimgray" :bold t))
  1262. ;;     (((class color) (background light)) (:foreground "purple" :weight bold))
  1263. ;;     (((class color) (background dark)) (:foreground "cyan" :weight bold))
  1264. ;;     (t (:bold t)))
  1265. ;;   "font lock mode face used to highlight keywords."
  1266. ;;   :group 'maxima)
  1267.  
  1268. ;; (defface maxima-operator-face
  1269. ;;   '((((type tty) (class color)) (:foreground "blue" :weight light))
  1270. ;;     (((class grayscale) (background light)) (:foreground "lightgray" :bold t))
  1271. ;;     (((class grayscale) (background dark)) (:foreground "dimgray" :bold t))
  1272. ;;     (((class color) (background light)) (:foreground "orchid" :weight bold))
  1273. ;;     (((class color) (background dark)) (:foreground "lightsteelblue" :weight bold))
  1274. ;;     (t (:bold t)))
  1275. ;;   "font lock mode face used to highlight builtins."
  1276. ;;   :group 'maxima)
  1277.  
  1278. ;; (defface maxima-property-face
  1279. ;;   '((((type tty) (class color)) (:foreground "green"))
  1280. ;;     (((class grayscale) (background light)) (:foreground "gray90" :bold t))
  1281. ;;     (((class grayscale) (background dark)) (:foreground "dimgray" :bold t))
  1282. ;;     (((class color) (background light)) (:foreground "forestgreen" :weight bold))
  1283. ;;     (((class color) (background dark)) (:foreground "palegreen" :weight bold))
  1284. ;;     (t (:bold t :underline t)))
  1285. ;;   "font lock mode face used to highlight type and classes."
  1286. ;;   :group 'maxima)
  1287.  
  1288. ;; (defface maxima-macro-face
  1289. ;;   '((((class color) (background dark)) (:foreground "steelblue1"))
  1290. ;;     (((class color) (background light)) (:foreground "blue3"))
  1291. ;;     (t (:underline t)))
  1292. ;;   "font lock mode face used to highlight preprocessor conditionals."
  1293. ;;   :group 'maxima)
  1294.  
  1295. ;; (defface maxima-specop-face
  1296. ;;   '((((type tty) (class color)) (:foreground "cyan" :weight bold))
  1297. ;;     (((class grayscale) (background light)) (:foreground "lightgray" :bold t))
  1298. ;;     (((class grayscale) (background dark)) (:foreground "dimgray" :bold t))
  1299. ;;     (((class color) (background light)) (:foreground "purple" :weight bold))
  1300. ;;     (((class color) (background dark)) (:foreground "cyan" :weight bold))
  1301. ;;     (t (:bold t)))
  1302. ;;   "font lock mode face used to highlight keywords."
  1303. ;;   :group 'maxima)
  1304.  
  1305. ;; (defface maxima-declaration-face
  1306. ;;   '((((type tty) (class color)) (:foreground "cyan" :weight bold))
  1307. ;;     (((class grayscale) (background light)) (:foreground "lightgray" :bold t))
  1308. ;;     (((class grayscale) (background dark)) (:foreground "dimgray" :bold t))
  1309. ;;     (((class color) (background light)) (:foreground "purple" :weight bold))
  1310. ;;     (((class color) (background dark)) (:foreground "cyan" :weight bold))
  1311. ;;     (t (:bold t)))
  1312. ;;   "font lock mode face used to highlight keywords."
  1313. ;;   :group 'maxima)
  1314.  
  1315. ;; (defface maxima-specsymb-face
  1316. ;;   '((((type tty) (class color)) (:foreground "red"))
  1317. ;;     (((class color) (background light)) (:foreground "red" :bold t))
  1318. ;;     (((class color) (background dark)) (:foreground "pink" :bold t))
  1319. ;;     (t (:inverse-video t :bold t)))
  1320. ;;   "font lock mode face used to highlight warnings."
  1321. ;;   :group 'maxima)
  1322.  
  1323. ;; (defface maxima-variable-face
  1324. ;;   '((((type tty) (class color)) (:foreground "yellow" :weight light))
  1325. ;;     (((class grayscale) (background light))
  1326. ;;      (:foreground "gray90" :bold t :italic t))
  1327. ;;     (((class grayscale) (background dark))
  1328. ;;      (:foreground "dimgray" :bold t :italic t))
  1329. ;;     (((class color) (background light)) (:foreground "darkgoldenrod" :italic t))
  1330. ;;     (((class color) (background dark)) (:foreground "lightgoldenrod" :italic t))
  1331. ;;     (t (:bold t :italic t)))
  1332. ;;   "font lock mode face used to highlight variable names."
  1333. ;;   :group 'maxima)
  1334.  
  1335. ;;; now, the keywords
  1336. (unless (facep 'font-lock-builtin-face)
  1337.   (copy-face 'font-lock-keyword-face 'font-lock-builtin-face))
  1338.  
  1339. (unless (facep 'font-lock-constant-face)
  1340.   (copy-face 'font-lock-keyword-face 'font-lock-constant-face))
  1341.  
  1342. (defvar maxima-font-lock-keywords-1
  1343.   `(
  1344.     (,maxima-match-declarations . font-lock-keyword-face))
  1345.     "Subdued level highlighting for Maxima mode.")
  1346.  
  1347. (defvar maxima-font-lock-keywords-2
  1348.   (append maxima-font-lock-keywords-1
  1349.    `(
  1350.      (,maxima-match-operators . font-lock-keyword-face)
  1351.      (,maxima-match-variables-1 . font-lock-keyword-face)
  1352.      (,maxima-match-variables-2 . font-lock-keyword-face)
  1353.      (,maxima-match-variables-3 . font-lock-keyword-face)
  1354.      (,maxima-match-variables-4 . font-lock-keyword-face)
  1355.      (,maxima-match-functions-1 . font-lock-builtin-face)
  1356.      (,maxima-match-functions-2 . font-lock-builtin-face)
  1357.      (,maxima-match-functions-3 . font-lock-builtin-face)
  1358.      (,maxima-match-functions-4 . font-lock-builtin-face)
  1359.      (,maxima-match-functions-5 . font-lock-builtin-face)
  1360.      (,maxima-match-functions-6 . font-lock-builtin-face)
  1361.      (,maxima-match-constants-1 . font-lock-constant-face)
  1362.      (,maxima-match-constants-2 . font-lock-constant-face)
  1363.      (,maxima-match-constants-3 . font-lock-constant-face)
  1364.      (,maxima-match-constants-4 . font-lock-constant-face)
  1365.      (,maxima-match-keywords . font-lock-keyword-face)
  1366.      (,maxima-match-properties . font-lock-keyword-face)
  1367.      (,maxima-match-macros . font-lock-keyword-face)
  1368.      (,maxima-match-specops . font-lock-keyword-face)
  1369.      (,maxima-match-specsymbs-1 . font-lock-keyword-face)
  1370.      (,maxima-match-specsymbs-2 . font-lock-keyword-face)))
  1371.   "Medium level highlighting for Maxima mode.")
  1372.  
  1373. (defvar maxima-font-lock-keywords-3
  1374.   (append maxima-font-lock-keywords-2
  1375.     (list 
  1376.      (list "^\\(.*\\)(\\(.*\\)) *:="
  1377.            '(1 font-lock-function-name-face))
  1378.      (list "^.*(\\(.*\\)):="
  1379.            '(1 font-lock-variable-name-face))))
  1380.   "Gaudy level highlighting for Maxima mode.")
  1381.  
  1382. (defvar maxima-font-lock-keywords maxima-font-lock-keywords-1
  1383.   "Default expressions to highlight in Maxima mode.")
  1384.  
  1385. (defun maxima-font-setup ()
  1386.   (make-local-variable 'font-lock-defaults)
  1387.   (setq font-lock-defaults 
  1388.         '((maxima-font-lock-keywords maxima-font-lock-keywords-1 
  1389.            maxima-font-lock-keywords-2 maxima-font-lock-keywords-3)
  1390.           nil t)))
  1391.  
  1392. (add-hook 'maxima-mode-hook 'maxima-font-setup)
  1393.  
  1394. ;;; now for the symbols
  1395.  
  1396. (defvar maxima-symbols
  1397.   (mapcar
  1398.    (lambda (x) (list x))
  1399.    (append
  1400.     maxima-vars-1
  1401.     maxima-vars-2
  1402.     maxima-vars-3
  1403.     maxima-vars-4
  1404.     maxima-fns-1
  1405.     maxima-fns-2
  1406.     maxima-fns-3
  1407.     maxima-fns-4
  1408.     maxima-fns-5
  1409.     maxima-fns-6
  1410.     maxima-const-1
  1411.     maxima-const-2
  1412.     maxima-keywds
  1413.     maxima-props
  1414.     maxima-macros
  1415.     maxima-specops
  1416.     maxima-decs
  1417.     maxima-spsymbs-1)))
  1418.     
  1419. ;;; end of maxima-font-lock.el
  1420.